Repository navigation
test: grid3d's seams are pinned, and the import test no longer leaves a second copy of grid3d - #86
Merged
Merged
Conversation
… a second copy of grid3d Characterization tests were added for every place the grid3d views touch the outside world, ahead of a ports-and-adapters refactor: the page relay's string marshalling, pygbag's page objects, the browser branch of Grid3DView.open, the SDL and Gallium environment defaults, the shared projection and sun, clock reads, what the web view sends and when, the two views' event shapes, GRAPHIK_TOUCH, set3D, the 2D template's temp path and the scancode table. All 41 pass on the code as it is. test_importing_grid3d_loads_neither_strata_nor_pygame deleted every grid3d module and re-imported the package, leaving the new copies in sys.modules. Tests that ran after it held the old classes while Grid3DView.open's lazy import of web loaded the new ones, so pytest.raises(Unavailable) could miss the Unavailable it raised. The deleted modules are now put back through monkeypatch once the test ends. drafted by Claude on behalf of Daniel Stephenson Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LYNeuoCqxFpUXrFhxnTg89
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change adds tests only. It comes before a ports-and-adapters refactor of the grid3d views
(a separate PR stacked on this one), so the behaviour that refactor must keep is pinned on
today's code first.
test_grid3d_seams.py(41 tests) pins every place the desktop and browser views touchthe outside world:
PlatformRelay's string marshalling (JSON options, base64 messages,int()status,str()state,json.loadspoll, reduced motion read as an int) and its "no 3D view" messagepageObjectanswering only under emscriptenGrid3DView.openin a browser (reducedMotion or None, the clock and title passed through,a
failed:reason)SDL_VIDEODRIVERandGALLIUM_DRIVERdefaults, which never override a set value, andnothing touched on an unsupported system
web.NEAR_PLANE,FAR_PLANEand
SUN_DIRECTIONsent/lastSent, nothing before a board, no VIEWwithout a camera, nothing on a limit error, lights checked before sending, the animator's tick
savePng,close,readyandfailure()on the web viewview.stratainsetFractionsat height 0,GRAPHIK_TOUCH(exactly"1", never in a browser),set3D'scoercion,
templatePath("2D")'s temp path, and the scancode tabletest_importing_grid3d_loads_neither_strata_nor_pygamedeleted every
preponderous.graphik.grid3d*module and re-imported the package, leaving thenew copies behind. Tests that ran after it held the old classes, while
Grid3DView.open's lazyfrom .web import ...loaded the new ones, sopytest.raises(Unavailable)could miss theUnavailableactually raised. One of the new tests hit this. The deleted modules are now putback through
monkeypatchwhen the test ends.No production code was changed.
Test plan
strata-engine0.8.0: 493 → 534 passed, 0 skipped, 0 failed(the same with
GRAPHIK_REQUIRE_STRATA=1)GRAPHIK_REQUIRE_STRATA=1):312 → 353 passed
test_grid3d_scene.py,test_grid3d_seams.pyandtest_grid3d_web.pywere run together inthat order; before the fix the seams test failed there
drafted by Claude on behalf of Daniel Stephenson
🤖 Generated with Claude Code